<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title></title>

</head>
<body onload="init()">
<canvas id="mainCanvas" width="400px" height="300px"></canvas>
<script src="//cdn.bootcss.com/three.js/r83/three.min.js"></script>
<script type="text/javascript">
    function init() {
        var renderer = new THREE.WebGLRenderer({
            canvas: document.getElementById('mainCanvas')
        });
        
        // scene
        var scene = new THREE.Scene();
        // camera
        var camera = new THREE.OrthographicCamera(-1, 1, 1.5, -1.5, 1, 10);
        //THREE.OrthographicCamera(left, right, top, bottom, near, far)
        //这六个参数分别代表正交投影照相机拍摄到的空间的六个面的位置
        

        camera.position.set(4, -3, 5);
        camera.lookAt(new THREE.Vector3(0, 0, 0));
        scene.add(camera);

        // a cube in the scene
        var cube = new THREE.Mesh(new THREE.CubeGeometry(1, 1, 1),
            new THREE.MeshBasicMaterial({
                color: 0xff0000,
                wireframe: true
            })
        );
        scene.add(cube);
        renderer.render(scene, camera);

    }
</script>

</body>

</html>